home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEM / S-Z / Special Delivery™ Demo.cpt / Special Delivery™ Demo / Claris / Claris Translators / EPSF.rsrc / PS_102 < prev    next >
Text File  |  1991-06-19  |  3KB  |  144 lines

  1. %%BeginProcSet : clip2pathbbox
  2. /clip2pathbbox {
  3.     /magicNum linewidth 2 div 1 2 sqrt div mul def
  4.     pathbbox
  5.     /urymn exch magicNum add def
  6.     /urxmn exch magicNum add def
  7.     /llymn exch magicNum sub def
  8.     /llxmn exch magicNum sub def
  9.     newpath llxmn llymn moveto llxmn urymn lineto urxmn urymn lineto urxmn llymn lineto
  10.     closepath clip newpath
  11. } bind def
  12. %%EndProcSet 
  13. %% Line takes the following arguments:
  14. %% linewidth xEnd yEnd xStart yStart
  15. %%BeginProcSet : Line
  16. /Line {
  17. MAV /LC get length 0 ne
  18. {
  19.     gsave
  20.             newpath
  21.             MAV /ArrowType get length 0 eq
  22.             MAV /SD get length 0 eq and
  23.             {2 setlinecap /UseClip {clip2pathbbox} def }
  24.             {0 setlinecap /UseClip {} def } ifelse
  25.             0 792 translate
  26.             1 -1 scale
  27.             CTM currentmatrix pop
  28.             /yStart exch def /xStart exch def /yEnd exch def /xEnd exch def /linewidth exch def
  29.             MAV /ArrowType get length 0 eq xStart xEnd ne yStart yEnd ne and and
  30.             {xStart yStart moveto xEnd yEnd lineto UseClip xStart yStart moveto xEnd yEnd lineto}
  31.             {xStart yStart moveto xEnd yEnd lineto} ifelse
  32.             linewidth setlinewidth SD strokepath
  33.             CheckPath {LC PF ArrowType} if
  34.     grestore
  35. }
  36. {pop pop pop pop pop} ifelse
  37. } bind def
  38. /CompensateForStroke {
  39.     sin currentlinewidth mul
  40.     exch
  41.     cos currentlinewidth mul
  42.     dup 0 translate
  43.     4 -1 roll exch 2.0 mul sub
  44.     3 1 roll
  45.     2.0 mul sub
  46. } bind def
  47. /arrowdict 10 dict def
  48. arrowdict begin
  49.     /SwallowTail {
  50.         newpath
  51.         0.0 0.0 moveto
  52.         1.0 -.5 lineto
  53.         .666 0.0 lineto
  54.         1.0 .5 lineto
  55.         closepath
  56.     } bind def
  57.     /Triangular {
  58.         newpath
  59.         0.0 0.0 moveto
  60.         1.0 -.5 lineto
  61.         1.0 .5 lineto
  62.         closepath
  63.     } bind def
  64.     /OpenTri {
  65.         newpath
  66.         1.0 0.5 moveto
  67.         0.0 0.0 lineto
  68.         1.0 -0.5 lineto
  69.     } bind def
  70.     /ClosedTri {
  71.         newpath
  72.         1.0 0.5 moveto
  73.         0.0 0.0 lineto
  74.         1.0 -0.5 lineto
  75.         closepath
  76.     } bind def
  77.     /SlashBar {
  78.         newpath
  79.         0.5 -.5 moveto
  80.         -.5 0.5 lineto
  81.     } bind def
  82.     /Dot {
  83.         newpath
  84.         0.5 0.0 moveto
  85.         0 0 1 0 360 arc
  86.         closepath
  87.     } bind def
  88.     /ExtSlashBar {
  89.         newpath
  90.         1.0 -.5 moveto
  91.         0.0 0.5 lineto
  92.     } bind def
  93. end
  94. /ScaleArrowHead {
  95.     0 0 4 -2 roll
  96.     0 0 1 1
  97.     8 -4 roll GetBoxesRatio
  98.     scale
  99. } bind def
  100. /DrawArrowHead {
  101.     gsave
  102.     [] 0 setdash
  103.     currentpoint translate rotate
  104.     {
  105.         4 copy
  106.         gsave
  107.             initmatrix
  108.             100 200 translate
  109.             msave
  110.                 ScaleArrowHead pop
  111.                 arrowdict exch get exec
  112.             mrestore
  113.             strokepath
  114.             0 0 3 index 3 index
  115.             pathbbox 8 4 roll
  116.             GetBoxesRatio
  117.             4 2 roll
  118.         grestore
  119.         3 index 1.0 exch sub
  120.         6 -1 roll
  121.         {
  122.             2 index mul
  123.             0 translate
  124.         }{
  125.             pop
  126.         } ifelse
  127.         msave
  128.             ScaleArrowHead scale
  129.             arrowdict exch get exec
  130.         mrestore
  131.         strokepath
  132.     } {
  133.         msave
  134.         ScaleArrowHead
  135.         arrowdict exch get exec
  136.         mrestore
  137.     } ifelse
  138.         CheckPath {
  139.             LC PF
  140.         } if
  141.     grestore
  142. } bind def
  143. %%EndProcSet